package me.riverslob.dubbo.simple.consumer

import org.springframework.context.support.ClassPathXmlApplicationContext
import java.lang.String
import me.riverslob.dubbo.simple.DemoService

/**
 * @author 郑治明(zm.zheng)
 * @version 2.1 , Created on  13-6-24 下午5:11
 */
object Consumer {
  def main(args: Array[String]) {
    val context: ClassPathXmlApplicationContext = new ClassPathXmlApplicationContext("consumer.xml");
    context.start();
    val demoService:DemoService = context.getBean("demoService").asInstanceOf[DemoService]; // 获取远程服务代理
    val hello:String = demoService.sayHello("world"); // 执行远程方法
    println(hello) // 显示调用结果
  }
}
